import Vue from 'vue'
import Router from 'vue-router'
import page from './page'
import page1 from './page1'
import page2 from './page2'
import page3 from './page3'
import page4 from './page4'
import page5 from './page5'
import twin from './twin'
import industry from './industry'
import canola from "@/router/canola";

Vue.use(Router)
// 公共路由
export const constantRoutes = [
  {
    path: '/',
    redirect: '/bigScreen2'
  },
  page,
  page1, page2, page3, page4, page5, twin,industry,canola
  // {
  //   path: '/echarts',
  //   component: () => import('@/views/echarts')
  // },
  // {
  //   path: '/echarts5',
  //   component: () => import('@/views/echarts5')
  // }
]
// 动态路由，基于用户权限动态去加载
export const dynamicRoutes = [

]
// 防止连续点击多次路由报错
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(err => err)
}
export default new Router({
  base: process.env.VUE_APP_CONTEXT_PATH,
  mode: 'hash', // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})
